<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.2/css/all.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"littlefxc.github.io","root":"/","images":"/images","scheme":"Mist","version":"8.2.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}};
  </script>
<meta name="description" content="[toc] 1. Redis的持久化机制 - RDB1.1 什么是RDBRDB：每隔一段时间，把内存中的数据写入磁盘的临时文件，作为快照，恢复的时候把快照文件读进内存。如果宕机重启，那么内存里的数据肯定会没有的，那么再次启动redis后，则会恢复。 1.2 备份与恢复内存备份 –&gt; 磁盘临时文件临时文件 –&gt; 恢复到内存 1.3 RDB优劣势 优势 每隔一段时间备份，全量备份 灾备简单">
<meta property="og:type" content="article">
<meta property="og:title" content="Redis 持久化机制">
<meta property="og:url" content="http://littlefxc.github.io/2021/01/26/Redis-%E6%8C%81%E4%B9%85%E5%8C%96%E6%9C%BA%E5%88%B6/index.html">
<meta property="og:site_name" content="一年春又来">
<meta property="og:description" content="[toc] 1. Redis的持久化机制 - RDB1.1 什么是RDBRDB：每隔一段时间，把内存中的数据写入磁盘的临时文件，作为快照，恢复的时候把快照文件读进内存。如果宕机重启，那么内存里的数据肯定会没有的，那么再次启动redis后，则会恢复。 1.2 备份与恢复内存备份 –&gt; 磁盘临时文件临时文件 –&gt; 恢复到内存 1.3 RDB优劣势 优势 每隔一段时间备份，全量备份 灾备简单">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-01-26T12:52:40.000Z">
<meta property="article:modified_time" content="2021-03-25T13:15:48.996Z">
<meta property="article:author" content="一年春又来">
<meta property="article:tag" content="redis">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://littlefxc.github.io/2021/01/26/Redis-%E6%8C%81%E4%B9%85%E5%8C%96%E6%9C%BA%E5%88%B6/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>
<title>Redis 持久化机制 | 一年春又来</title>
  




  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="一年春又来" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">一年春又来</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-home"><a href="/" rel="section"><i class="home                          //首页 fa-fw"></i>首页</a></li>
        <li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="archive          //归档 fa-fw"></i>归档</a></li>
        <li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="th           //分类 fa-fw"></i>分类</a></li>
        <li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="tags                     //标签 fa-fw"></i>标签</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#1-Redis%E7%9A%84%E6%8C%81%E4%B9%85%E5%8C%96%E6%9C%BA%E5%88%B6-RDB"><span class="nav-text">1. Redis的持久化机制 - RDB</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-1-%E4%BB%80%E4%B9%88%E6%98%AFRDB"><span class="nav-text">1.1 什么是RDB</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-2-%E5%A4%87%E4%BB%BD%E4%B8%8E%E6%81%A2%E5%A4%8D"><span class="nav-text">1.2 备份与恢复</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-3-RDB%E4%BC%98%E5%8A%A3%E5%8A%BF"><span class="nav-text">1.3 RDB优劣势</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-4-RDB%E7%9A%84%E9%85%8D%E7%BD%AE"><span class="nav-text">1.4 RDB的配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-5-%E6%80%BB%E7%BB%93"><span class="nav-text">1.5 总结</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#2-Redis%E7%9A%84%E6%8C%81%E4%B9%85%E5%8C%96%E6%9C%BA%E5%88%B6-AOF"><span class="nav-text">2 Redis的持久化机制 - AOF</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#2-1-AOF%E7%89%B9%E7%82%B9"><span class="nav-text">2.1 AOF特点</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-2-%E4%BC%98%E5%8A%BF"><span class="nav-text">2.2 优势</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-3-%E5%8A%A3%E5%8A%BF"><span class="nav-text">2.3 劣势</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-4-AOF%E7%9A%84%E9%85%8D%E7%BD%AE"><span class="nav-text">2.4 AOF的配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-5-%E5%88%B0%E5%BA%95%E9%87%87%E7%94%A8RDB%E8%BF%98%E6%98%AFAOF%E5%91%A2%EF%BC%9F"><span class="nav-text">2.5 到底采用RDB还是AOF呢？</span></a></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">一年春又来</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">234</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">38</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">125</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://littlefxc.github.io/2021/01/26/Redis-%E6%8C%81%E4%B9%85%E5%8C%96%E6%9C%BA%E5%88%B6/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="一年春又来">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="一年春又来">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Redis 持久化机制
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2021-01-26 20:52:40" itemprop="dateCreated datePublished" datetime="2021-01-26T20:52:40+08:00">2021-01-26</time>
    </span>
      <span class="post-meta-item">
        <span class="post-meta-item-icon">
          <i class="far fa-calendar-check"></i>
        </span>
        <span class="post-meta-item-text">更新于</span>
        <time title="修改时间：2021-03-25 21:15:48" itemprop="dateModified" datetime="2021-03-25T21:15:48+08:00">2021-03-25</time>
      </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E7%BC%93%E5%AD%98/" itemprop="url" rel="index"><span itemprop="name">缓存</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <p>[toc]</p>
<h1 id="1-Redis的持久化机制-RDB"><a href="#1-Redis的持久化机制-RDB" class="headerlink" title="1. Redis的持久化机制 - RDB"></a>1. Redis的持久化机制 - RDB</h1><h2 id="1-1-什么是RDB"><a href="#1-1-什么是RDB" class="headerlink" title="1.1 什么是RDB"></a>1.1 什么是RDB</h2><p>RDB：每隔一段时间，把内存中的数据写入磁盘的临时文件，作为快照，恢复的时候把快照文件读进内存。如果宕机重启，那么内存里的数据肯定会没有的，那么再次启动redis后，则会恢复。</p>
<h2 id="1-2-备份与恢复"><a href="#1-2-备份与恢复" class="headerlink" title="1.2 备份与恢复"></a>1.2 备份与恢复</h2><p>内存备份 –&gt; 磁盘临时文件临时文件 –&gt; 恢复到内存</p>
<h2 id="1-3-RDB优劣势"><a href="#1-3-RDB优劣势" class="headerlink" title="1.3 RDB优劣势"></a>1.3 RDB优劣势</h2><ul>
<li>优势<ol>
<li>每隔一段时间备份，全量备份</li>
<li>灾备简单，可以远程传输</li>
<li>子进程备份的时候，主进程不会有任何io操作（不会有写入修改或删除），保证备份数据的的完整性</li>
<li>相对AOF来说，当有更大文件的时候可以快速重启恢复</li>
</ol>
</li>
<li>劣势<ol>
<li>发生故障是，有可能会丢失最后一次的备份数据</li>
<li>子进程所占用的内存比会和父进程一模一样，如会造成CPU负担</li>
<li>由于定时全量备份是重量级操作，所以对于实时备份，就无法处理了。</li>
</ol>
</li>
</ul>
<h2 id="1-4-RDB的配置"><a href="#1-4-RDB的配置" class="headerlink" title="1.4 RDB的配置"></a>1.4 RDB的配置</h2><ol>
<li><p>保存位置，可以在redis.conf自定义：/user/local/redis/working/dump.rdb</p>
</li>
<li><p>保存机制：</p>
 <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">save 900 1</span><br><span class="line">save 300 10</span><br><span class="line">save 60 10000</span><br><span class="line">save 10 3</span><br></pre></td></tr></table></figure>

 <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">如果1个缓存更新，则15分钟后备份</span><br><span class="line">* 如果10个缓存更新，则5分钟后备份</span><br><span class="line">* 如果10000个缓存更新，则1分钟后备份</span><br><span class="line">* 演示：更新3个缓存，10秒后备份</span><br><span class="line">* 演示：备份dump.rdb，删除重启</span><br></pre></td></tr></table></figure></li>
<li><p>stop-writes-on-bgsave-error<br> ◦ yes：如果save过程出错，则停止写操作<br> ◦ no：可能造成数据不一致</p>
</li>
<li><p>rdbcompression<br> ◦ yes：开启rdb压缩模式<br> ◦ no：关闭，会节约cpu损耗，但是文件会大，道理同nginx</p>
</li>
<li><p>rdbchecksum<br> ◦ yes：使用CRC64算法校验对rdb进行数据校验，有10%性能损耗<br> ◦ no：不校验</p>
</li>
</ol>
<h2 id="1-5-总结"><a href="#1-5-总结" class="headerlink" title="1.5 总结"></a>1.5 总结</h2><p>RDB适合大量数据的恢复，但是数据的完整性和一致性可能会不足。</p>
<h1 id="2-Redis的持久化机制-AOF"><a href="#2-Redis的持久化机制-AOF" class="headerlink" title="2 Redis的持久化机制 - AOF"></a>2 Redis的持久化机制 - AOF</h1><p>RDB会丢失最后一次备份的rdb文件，但是其实也无所谓，其实也可以忽略不计，毕竟是缓存，丢了就丢了，但是如果追求数据的完整性，那就的考虑使用AOF了。</p>
<h2 id="2-1-AOF特点"><a href="#2-1-AOF特点" class="headerlink" title="2.1 AOF特点"></a>2.1 AOF特点</h2><ol>
<li>以日志的形式来记录用户请求的写操作。读操作不会记录，因为写操作才会存存储。</li>
<li>文件以追加的形式而不是修改的形式。</li>
<li>redis的aof恢复其实就是把追加的文件从开始到结尾读取执行写操作。</li>
</ol>
<h2 id="2-2-优势"><a href="#2-2-优势" class="headerlink" title="2.2 优势"></a>2.2 优势</h2><ol>
<li>AOF更加耐用，可以以秒级别为单位备份，如果发生问题，也只会丢失最后一秒的数据，大大增加了可靠性和数据完整性。所以AOF可以每秒备份一次，使用fsync操作。</li>
<li>以log日志形式追加，如果磁盘满了，会执行 redis-check-aof 工具</li>
<li>当数据太大的时候，redis可以在后台自动重写aof。当redis继续把日志追加到老的文件中去时，重写也是非常安全的，不会影响客户端的读写操作。</li>
<li>AOF 日志包含的所有写操作，会更加便于redis的解析恢复。</li>
</ol>
<h2 id="2-3-劣势"><a href="#2-3-劣势" class="headerlink" title="2.3 劣势"></a>2.3 劣势</h2><ol>
<li>相同的数据，同一份数据，AOF比RDB大</li>
<li>针对不同的同步机制，AOF会比RDB慢，因为AOF每秒都会备份做写操作，这样相对与RDB来说就略低。 每秒备份fsync没毛病，但是如果客户端的每次写入就做一次备份fsync的话，那么redis的性能就会下降。</li>
<li>AOF发生过bug，就是数据恢复的时候数据不完整，这样显得AOF会比较脆弱，容易出现bug，因为AOF没有RDB那么简单，但是呢为了防止bug的产生，AOF就不会根据旧的指令去重构，而是根据当时缓存中存在的数据指令去做重构，这样就更加健壮和可靠了。</li>
</ol>
<h2 id="2-4-AOF的配置"><a href="#2-4-AOF的配置" class="headerlink" title="2.4 AOF的配置"></a>2.4 AOF的配置</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"># AOF 默认关闭，yes可以开启</span><br><span class="line">appendonly no</span><br><span class="line"></span><br><span class="line"># AOF 的文件名</span><br><span class="line">appendfilename &quot;appendonly.aof&quot;</span><br><span class="line"></span><br><span class="line"># no：不同步</span><br><span class="line"># everysec：每秒备份，推荐使用</span><br><span class="line"># always：每次操作都会备份，安全并且数据完整，但是慢性能差</span><br><span class="line">appendfsync everysec</span><br><span class="line"></span><br><span class="line"># 重写的时候是否要同步，no可以保证数据安全</span><br><span class="line">no-appendfsync-on-rewrite no</span><br><span class="line"></span><br><span class="line"># 重写机制：避免文件越来越大，自动优化压缩指令，会fork一个新的进程去完成重写动作，新进程里的内存数据会被重写，此时旧的aof文件不会被读取使用，类似rdb</span><br><span class="line"># 当前AOF文件的大小是上次AOF大小的100% 并且文件体积达到64m，满足两者则触发重写</span><br><span class="line">auto-aof-rewrite-percentage 100</span><br><span class="line">auto-aof-rewrite-min-size 64mb</span><br></pre></td></tr></table></figure>

<h2 id="2-5-到底采用RDB还是AOF呢？"><a href="#2-5-到底采用RDB还是AOF呢？" class="headerlink" title="2.5 到底采用RDB还是AOF呢？"></a>2.5 到底采用RDB还是AOF呢？</h2><ol>
<li>如果你能接受一段时间的缓存丢失，那么可以使用RDB</li>
<li>如果你对实时性的数据比较care，那么就用AOF</li>
<li>使用RDB和AOF结合一起做持久化，RDB做冷备，可以在不同时期对不同版本做恢复，AOF做热备，保证数据仅仅只有1秒的损失。当AOF破损不可用了，那么再用RDB恢复，这样就做到了两者的相互结合，也就是说Redis恢复会先加载AOF，如果AOF有问题会再加载RDB，这样就达到冷热备份的目的了。</li>
</ol>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/redis/" rel="tag"># redis</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2021/01/26/Rabbitmq%E9%AB%98%E7%BA%A7%E7%89%B9%E6%80%A7-%E7%94%9F%E4%BA%A7%E7%AB%AF%E7%89%B9%E6%80%A7%E8%AE%B2%E8%A7%A3-%E7%A1%AE%E8%AE%A4%E6%9C%BA%E5%88%B6%E5%92%8C%E8%BF%94%E5%9B%9E%E6%9C%BA%E5%88%B6-20/" rel="prev" title="Rabbitmq高级特性-生产端特性讲解_确认机制和返回机制(20)">
                  <i class="fa fa-chevron-left"></i> Rabbitmq高级特性-生产端特性讲解_确认机制和返回机制(20)
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2021/01/26/Redis%E7%9A%84%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/" rel="next" title="Redis的数据类型">
                  Redis的数据类型 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>







<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      const commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">一年春又来</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/mist/" class="theme-link" rel="noopener" target="_blank">NexT.Mist</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script>

  
<script src="/js/local-search.js"></script>






  





</body>
</html>
